Rendering VoxelsΒΆ

Guerilla Render renders voxel from Maya Fluid and OpenVDB fluids.

Using Maya Fluids

Guerilla can render Maya Fluids (only the 3d ones) as regular volumes.

The Maya fluids are exported from Maya using the Guerilla Render plug-in as any other objects. Once in Guerilla, assign the Volume shader to the fluid object using the RenderGraph as usual and set the voxel attributes (like density, temperature, fuel) in the shader as explained below.

Here are the Maya Fluids attributes available in Guerilla Render : "color", "coordinates", "density", "fallof", "fuel", "pressure", "temperature", "velocity"

If the Maya fluid has been cached in a MayaCache, the Guerilla plug-in will directly reference the cache file and won't export again the fluid values.

Using OpenVDB

Drag'n drop the OpenVDB file in a Guerilla viewport (or open it with "Create Reference"). This will add a reference on the OpenVDB file. Assign the Volume shader to the fluid object using the RenderGraph as usual and set the voxel attributes (like density, temperature, fuel) in the shader as explained below.

If you have a sequence of openvdb files replace the sequence number in "Object -> Geometry -> Geometry Filename" by the matching pattern :

FilenamePattern
explosion1.vdbexplosion$f.vdb
explosion01.vdbexplosion$02f.vdb
explosion001.vdbexplosion$03f.vdb
explosion0001.vdbexplosion$04f.vdb

Setup the voxel density

Using the RenderGraph, add a Materials/Volume node.

Library/Materials/Volume for all the details about the default volume shader.

On the Volume -> Density attribute, press the M button and select the Voxel sub-shader.

Library/Attributes/Voxel for all the details about the voxel sub-shader.

Select the voxel channel for the density ("density" should work for Maya Fluids and some OpenVDB fluids).

Tweak the density range using the Voxel -> Range -> OutMin/OutMax attributes.

The voxel primitive are assumed to have an heterogeneous density, whatever the state of the "Attributes -> Volume -> Uniform Density" attribute.

Setup the voxel ray marching

The voxel is looking blocky here because the ray marching step is too big.

We add an RenderGraph/Attribute node and set the "Ray Marching Step Size" to 0.1

Rendering a voxel with motion blur

If the voxel includes a velocity channel, Guerilla renders the voxel with motion blur. Adjust the amount of motion blur using the Primitive -> Volume -> Motion Blur Amount attribute. Like for other objects, the motion blur can be disabled using the Primitive -> SceneGraphNode -> Motion Blur attribute.

The same fluid with no motion blur and with motion blur.

Adding noise to a voxel

The same fluid with no noise, a simple noise and a noise using texture coordinates.

Add noise to a voxel

Let's add some noise in the voxel Density.

  1. In the RenderGraph, select the volume node with the Voxel sub-shader.
  2. Set the Voxel -> Noise -> Octaves attribute to 1.
  3. Increase the Voxel -> Noise -> Intensity attribute till you got see some displacement in the voxel.
  4. Tweak the Voxel -> Noise -> Scale attribute to adjust the noise base frequency.
  5. Then increase the Voxel -> Noise -> Octaves attribute to add noise details.
Add noise to a voxel using the texture coordinates

If your voxel have texture coordinates (Maya generates those coordinates if you turn in Maya the FluidShape -> Textures -> Coordinate Method to Grid), you can deform the noise with the voxel simulation.

Noise using the texture coordinates

  1. In the RenderGraph, select the volume node with the Voxel sub-shader.
  2. Check the Voxel -> Noise -> Grid Coordinates attribute.
  3. Set the Voxel -> Noise -> Octaves attribute to 1.
  4. Increase the Voxel -> Noise -> Intensity attribute till you got see some displacement in the voxel.
  5. Tweak the Voxel -> Noise -> Scale attribute to adjust the noise base frequency.
  6. Then increase the Voxel -> Noise -> Octaves attribute to add noise details.
The Help > Samples > Voxel Noise sample for the details. Library/Attributes/Cloud and Library/Sub Shaders/Voxel for all the details about the sub-shaders.

Setup the voxel temperature

Follow the same instructions as the density, but on the Volume -> Black Body -> Temperature attribute. Choose the correct voxel channel for the temperature ("temperature" should work for Maya Fluids and some OpenVDB fluids).

Tweak the density range using the Voxel -> Range -> OutMin/OutMax attributes. You may have to use a OutMax around 1000 or 2000 (Kelvin degrees). Tweak Volume -> Black Body -> Intensity to get the final incandescence.

The Help > Samples > Voxel Shading sample for the details.

Setup a voxel with a color gradient

Let's control the Volume Incandescence attribute with the Maya fluid "fuel" attribute.

Create first a sub-shading network for the Volume -> Incandescence attribute. To do that, drag'n drop the Incandescence Attribute in a viewport. It will create a new shading network for this attribute.

In this new shading network, add a Voxel node (in the library : "Attributes -> Voxel") and a Gradient node (Node Picker and tip "gradient" and select "texture/Gradient").

Create the shading network. The Volume -> Incandescence attribute is now controlled by the voxel's fuel channel through a custom color gradient.

The Help > Samples > Voxel Shading sample for the details.